{% extends "source/board/boardTemplates/Kconfig-boardOptions.jinja" %}
{% block options %}
{% set chipFamily = dictionary['chip']['compatible'][1].rpartition(',')[2] %}
{% if 'VDD' in dictionary['chip'] %}

config CHIP_{{ chipFamily }}_VDD_MV_CONFIGURABLE
	bool
	default n

config CHIP_{{ chipFamily }}_VDD_MV_DEFAULT
	int
	default {{ (dictionary['chip']['VDD']['output-voltage'] * 1000) | int }}
{% endif %}
{% if 'clocks' in dictionary %}
{% for key, clock in dictionary['clocks'].items() if 'ST,STM32-HSE' in clock['compatible'] %}
{% if clock['frequency'] != 0 or clock.get('bypass', False) == True %}

config CHIP_{{ chipFamily }}_RCC_HSE_CLOCK_BYPASS_CONFIGURABLE
	bool
	default n

config CHIP_{{ chipFamily }}_RCC_HSE_CLOCK_BYPASS_DEFAULT
	bool
	default {% if clock.get('bypass', False) == True %}y{% else %}n{% endif %}{{ '' }}
{% endif %}
{% if clock['frequency'] != 0 %}

config CHIP_{{ chipFamily }}_RCC_HSE_FREQUENCY_CONFIGURABLE
	bool
	default n

config CHIP_{{ chipFamily }}_RCC_HSE_FREQUENCY_DEFAULT
	int
	default {{ clock['frequency'] }}
{% endif %}
{% endfor %}
{% endif %}
{% endblock %}
